from django.db import models

# Create your models here.

class U_user(models.Model):
    TYPE=[('1','学生'),('2','老师')]
    id=models.AutoField(primary_key=True)
    uname=models.CharField(max_length=20,null=False)
    upwd=models.CharField(max_length=20,null=False)
    role=models.CharField(max_length=1,choices=TYPE)

class T_type(models.Model):
    id = models.AutoField(primary_key=True)
    tname=models.CharField(max_length=20,null=False)

class M_jia(models.Model):
    C=[
        ('0','待审核'),
        ('1','通过'),
        ('2','未通过'),
    ]
    id = models.AutoField(primary_key=True)
    stu_name = models.CharField(max_length=20, null=False)
    status=models.CharField(max_length=1,choices=C,null=False,default='0')
    createtime=models.DateField(auto_now_add=True)
    context=models.CharField(max_length=200,null=False)
    tid=models.ForeignKey(T_type,on_delete=models.CASCADE)